package
{
	import flash.display.DisplayObjectContainer;
	import flash.geom.Point;
	
	import phi.engine.actors.PolygonActor;
	import phi.engine.core.Game;
	import phi.engine.layers.HScrollLayer;
	import phi.engine.layers.Layer;
	import phi.game.ball.actors.BuildingActor;
	import phi.game.ball.actors.HillsActor;
	import phi.game.ball.actors.MountainsActor;
	import phi.game.ball.layers.BlocksScrollLayer;
	
	public class TestGame extends Game
	{
		public function TestGame(window:DisplayObjectContainer)
		{
			super(window);
		}
		
		// --------------------------------------------------------------------
		// Public functions
		// --------------------------------------------------------------------
		
		override public function init():void
		{
			super.init();
			createLayers();
		}

		
		protected function createLayers():void
		{
			var hillsLayer :HScrollLayer = new HScrollLayer();
			var mountainsLayer :HScrollLayer = new HScrollLayer();
			var bloksLayer :BlocksScrollLayer = new BlocksScrollLayer();
			
			// Hills
			hillsLayer.scrollActorClass = HillsActor;
			hillsLayer.velocity = new Point( 2, 0 );
			hillsLayer.padding = -14;
			hillsLayer.y = 150;
			
			// Mountains
			mountainsLayer.scrollActorClass = MountainsActor;
			mountainsLayer.velocity = new Point(0.5, 0 );
			mountainsLayer.padding = -5;
			mountainsLayer.y = 80;
			
			// Blocks
			bloksLayer.scrollActorClass = BuildingActor;
			bloksLayer.padding = 5;
			bloksLayer.topPadding = 600;
			bloksLayer.velocity = new Point( 200, 0 );
			
			sceneManager.addLayer( mountainsLayer );
			sceneManager.addLayer( hillsLayer );
			sceneManager.addLayer( bloksLayer );
			sceneManager.addLayer( new Layer(), true );
		}
	}
}